home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / hplip / fax / faxdevice.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2009-10-28  |  1KB  |  33 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from base.g import *
  5. from prnt import cups
  6. from base import device, codes
  7. from soapfax import SOAPFaxDevice
  8. from pmlfax import PMLFaxDevice
  9.  
  10. def FaxDevice(device_uri = None, printer_name = None, callback = None, fax_type = FAX_TYPE_NONE, disable_dbus = False):
  11.     if fax_type == FAX_TYPE_NONE:
  12.         if device_uri is None and printer_name is not None:
  13.             printers = cups.getPrinters()
  14.             for p in printers:
  15.                 if p.name.lower() == printer_name.lower():
  16.                     device_uri = p.device_uri
  17.                     break
  18.                     continue
  19.             else:
  20.                 raise Error(ERROR_DEVICE_NOT_FOUND)
  21.         if device_uri is not None:
  22.             mq = device.queryModelByURI(device_uri)
  23.             fax_type = mq['fax-type']
  24.         
  25.     
  26.     log.debug('fax-type=%d' % fax_type)
  27.     if fax_type in (FAX_TYPE_BLACK_SEND_EARLY_OPEN, FAX_TYPE_BLACK_SEND_LATE_OPEN):
  28.         return PMLFaxDevice(device_uri, printer_name, callback, fax_type, disable_dbus)
  29.     if fax_type == FAX_TYPE_SOAP:
  30.         return SOAPFaxDevice(device_uri, printer_name, callback, fax_type, disable_dbus)
  31.     raise Error(ERROR_DEVICE_DOES_NOT_SUPPORT_OPERATION)
  32.  
  33.